home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 09-20.C < prev    next >
Text File  |  1992-01-31  |  739b  |  39 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    char bitmap[256];
  10.    int old_mode, new_mode;
  11.    int width;
  12.  
  13.    new_mode = fg_bestmode(320,200,1);
  14.    if (new_mode < 0 || new_mode == 12) {
  15.       printf("This program requires a 320 ");
  16.       printf("x 200 color graphics mode.\n");
  17.       exit(1);
  18.       }
  19.  
  20.    old_mode = fg_getmode();
  21.    fg_setmode(new_mode);
  22.    width = (int)fg_imagesiz(32,1);
  23.  
  24.    fg_setcolor(7);
  25.    fg_rect(0,31,0,7);
  26.    fg_setcolor(9);
  27.    fg_text("text",4);
  28.    fg_waitkey();
  29.  
  30.    fg_move(0,7);
  31.    fg_getimage(bitmap,width,8);
  32.    fg_move(4,15);
  33.    fg_drwimage(bitmap,width,8);
  34.    fg_waitkey();
  35.  
  36.    fg_setmode(old_mode);
  37.    fg_reset();
  38. }
  39.